"use strict";

const list = [
  {
    pid: 0,
    name: "SystemManagement",
    menuType: 0,
    title: "系统管理",
    path: "/sys",
    component: "Layout",
    redirect: "",
    icon: "ep:plus",
    sort: 1,
    position: 0,
    hidden: false,
    affix: false,
    noTagView: false,
    alwaysShow: false,
    noCache: true,
    createdAt: new Date(),
    updatedAt: new Date(),
  },
  {
    pid: 1,
    name: "UserManagement",
    menuType: 0,
    title: "用户管理",
    path: "/user",
    component: "/view/system/users/index",
    redirect: "",
    icon: "",
    sort: 1,
    position: 0,
    hidden: false,
    affix: false,
    noTagView: false,
    alwaysShow: false,
    noCache: true,
    createdAt: new Date(),
    updatedAt: new Date(),
  },
  {
    pid: 1,
    name: "RoleManagement",
    menuType: 0,
    title: "角色管理",
    path: "/role",
    component: "/view/system/roles/index",
    redirect: "",
    icon: "",
    sort: 2,
    position: 0,
    hidden: false,
    affix: false,
    noTagView: false,
    alwaysShow: false,
    noCache: true,
    createdAt: new Date(),
    updatedAt: new Date(),
  },
  {
    pid: 1,
    name: "MenuManagement",
    menuType: 0,
    title: "菜单管理",
    path: "/menu",
    component: "/view/system/menus/index",
    redirect: "",
    icon: "",
    sort: 3,
    position: 0,
    hidden: false,
    affix: false,
    noTagView: false,
    alwaysShow: false,
    noCache: false,
    createdAt: new Date(),
    updatedAt: new Date(),
  },
  {
    pid: 2,
    name: "sys:user:add",
    menuType: 1,
    title: "添加操作",
    createdAt: new Date(),
    updatedAt: new Date(),
  },
  {
    pid: 2,
    name: "sys:user:del",
    menuType: 1,
    title: "删除操作",
    createdAt: new Date(),
    updatedAt: new Date(),
  },
];

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
     */
    await queryInterface.bulkInsert("Menus", list, {});
  },

  async down(queryInterface, Sequelize) {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete("Menus", null, {});
  },
};
